import request from '@/utils/request'

/**
 * 获取选题数据信息
 * @param params
 */
export function fetchSelectTopicDetail(params: any = {}) {
  return request({
    url: `/zgyp-work/api/v1/selectTopic/${params.assetId}/form`,
    method: 'get',
    params,
  })
}
/**
 * 修改选题信息
 * @param data
 */
export function editSelectTopic(data?: any) {
  return request({
    url: `/zgyp-work/api/v1/selectTopic/${data.id}`,
    method: 'put',
    data,
  })
}
/**
 * 删除选题
 * @param data
 */
export function deleteSelectTopic(data: any) {
  return request({
    url: `/zgyp-work/api/v1/selectTopic/${data.ids}`,
    method: 'DELETE',
    data,
  })
}

/**
 * 选题数据分页列表
 * @param params
 */
export function fetchSelectTopicList(data: any = {}) {
  return request({
    url: '/zgyp-work/api/v1/selectTopic/page',
    method: 'post',
    data,
  })
}

/**
 * 选题-内容汇报
 * @param data
 */
export function reportSelectTopic(data: any) {
  return request({
    url: `/zgyp-work/api/v1/selectTopic/reportSelectTopic/${data.id}`,
    method: 'post',
    data,
  })
}
/**
 * 获取业绩数据信息（账号）
 * @param params
 */
export function fetchTopicRecord(params?: any) {
  return request({
    url: `/zgyp-work/api/v1/TopicRecord/${params.assetId}/form`,
    method: 'get',
    params,
  })
}
/**
 * 修改业绩信息（账号）
 * @param data
 */
export function editTopicRecord(data: any) {
  return request({
    url: `/zgyp-work/api/v1/TopicRecord/${data.id}`,
    method: 'put',
    data,
  })
}
/**
 * 新增加选题
 * @param data
 */
export function addSelectTopic(data: any) {
  return request({
    url: `/zgyp-work/api/v1/selectTopic/saveSelectTopic`,
    method: 'post',
    data,
  })
}

/**
 * 业绩填报（账号）
 * @param data
 */
export function flexibleTopicRecord(data: any) {
  return request({
    url: `/zgyp-work/api/v1/TopicRecord/saveTopicDataAccount`,
    method: 'post',
    data,
  })
}
/**
 * 选题业绩分页列表（账号）
 * @param data
 */
export function fetchTopicRecordList(data?: any) {
  return request({
    url: `/zgyp-work/api/v1/TopicRecord/page`,
    method: 'post',
    data,
  })
}

/**
 * 选题内容填报
 * @param data
 */
export function contentReport(data: any) {
  return request({
    url: `/zgyp-work/api/v1/selectTopic/contentReport/${data.id}`,
    method: 'post',
    data,
  })
}

/**
 * 删除业绩（账号）
 * @param data
 */
export function deleteTopicRecord(data: any) {
  return request({
    url: `/zgyp-work/api/v1/TopicRecord/${data.ids}`,
    method: 'DELETE',
    data,
  })
}

/**
 * 选题内容填报
 * @param data
 */
export function fetchTopicStatistic(data: any) {
  return request({
    url: `/zgyp-work/api/v1/TopicRecord/TopicStatistic/cate`,
    method: 'post',
    data,
  })
}

/**
 * 删除业绩(选题)
 * @param data
 */
export function deleteTopicPerformance(data: any) {
  return request({
    url: `/zgyp-work/api/v1/TopicPerformance/${data.ids}`,
    method: 'DELETE',
    data,
  })
}
/**
 * 获取业绩数据信息（选题）
 * @param params
 */
export function fetchTopicPerformance(params?: any) {
  return request({
    url: `/zgyp-work/api/v1/TopicPerformance/${params.assetId}/form`,
    method: 'get',
    params,
  })
}
/**
 * 修改业绩信息（选题）
 * @param data
 */
export function editTopicPerformance(data: any) {
  return request({
    url: `/zgyp-work/api/v1/TopicPerformance/${data.id}`,
    method: 'put',
    data,
  })
}

/**
 * 选题业绩添加（选题）
 * @param data
 */
export function flexibleTopicPerformance(data: any) {
  return request({
    url: `/zgyp-work/api/v1/TopicPerformance/saveTopicPerformance`,
    method: 'post',
    data,
  })
}
/**
 * 业绩分页列表（选题）
 * @param data
 */
export function fetchTopicTopicPerformance(data?: any) {
  return request({
    url: `/zgyp-work/api/v1/TopicPerformance/page`,
    method: 'post',
    data,
  })
}
